home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Almathera Ten Pack 3: CDPD 3
/
Almathera Ten on Ten - Disc 3: CDPD3.iso
/
fish
/
001-100
/
001-025
/
010
/
dehex
/
dehex.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-03-17
|
424b
|
28 lines
#include <stdio.h>
main ()
{
auto char buf[128];
register int ch;
register int packed;
register char *scan;
while (gets (buf)) {
for (scan = buf; *scan != '\000'; ) {
ch = *scan++;
if (ch > '9') {
packed = (ch - '7') << 4;
} else {
packed = (ch - '0') << 4;
}
ch = *scan++;
if (ch > '9') {
packed |= (ch - '7');
} else {
packed |= (ch - '0');
}
putchar (packed);
}
}
}